Page({
  /**
   * 页面的初始数据
   */
  data: {
    imgUrls: [
      '/images/manage/top-1.jpg',
      '/images/manage/top-2.jpg',
      '/images/manage/top-3.jpg',
    ],
    indicatorDots: false,
    autoplay: false,
    interval: 3000,
    duration: 800,
    showView: true
  },
  methods: {
    onClick(event) {
      console.log(event)
      wx.navigateTo({
        url: 'pages/index/index'
      })
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(e) {

    showView: (e.showView == "true" ? true : false)

  },
  onChangeShowState: function() {
    var that = this;
    that.setData({
      showView: (!that.data.showView)
    })


  },

  partnerlist: function () {
    var that = this;
    var usertype = wx.getStorageSync('usertype');
    if (usertype == "2") {
      wx.navigateTo({
        url: '/pages/partnerlist/partner',
      })
    } else {
      wx.showToast({
        title: "抱歉，您无权限使用本功能！",
        icon: 'none',
        duration: 2000
      });
    }
  },
  
  partneradd: function () {
    var that = this;
    var usertype = wx.getStorageSync('usertype');
    usertype = parseInt(usertype);
    if (usertype == "2") {
      wx.navigateTo({
        url: '/pages/memberadd/memberadd',
      })
    } else {
      wx.showToast({
        title: "抱歉，您无权限使用本功能！",
        icon: 'none',
        duration: 2000
      });
    }
  },

  partnermon: function () {
    var that = this;
    var usertype = wx.getStorageSync('usertype');
    usertype = parseInt(usertype);
    if (usertype == "2") {
      wx.navigateTo({
        url: '/pages/partnerinc/partnerinc',
      })
    } else {
      wx.showToast({
        title: "抱歉，您无权限使用本功能！",
        icon: 'none',
        duration: 2000
      });
    }
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})